package com.itholmes.utils;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;

public class CookieUtils {
	public static int cookiesEaxm(HttpServletRequest req) {
		int user_id = -1;
		Cookie[] cookies = req.getCookies();
		for(Cookie c : cookies) {
			if(c.getName().toString().equals("user_id")) {
				user_id = Integer.parseInt(c.getValue());
				System.out.println();
			}
		}
		return user_id;
	}
}
